"""
统计访问对象
"""
from concurrent.driver import DatabaseDriver

def goods_count_by_type(driver: DatabaseDriver):
    """
    查询各类别的图书数量
    :param driver:
    :return:
    """
    return driver.query_all(
        f"SELECT b.cate_name, COUNT(a.goods_id) AS count FROM goods a INNER JOIN ON a,cate_id = b.cate_id GROUP BY "
        f"a.cate_id ")